Part Number Hot Search : 
N74F194D CY203708 04424 A180C 04424 Q5259B AD7306JR 01102
Product Description
Full Text Search
 

To Download ATMEGA16U2-AU Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  features ? high performance, low power avr ? 8-bit microcontroller ? advanced risc architecture ? 125 powerful instructions ? most single clock cycle execution ? 32 x 8 general purpose working registers ? fully static operation ? up to 16 mips throughput at 16 mhz ? non-volatile program and data memories ? 8k/16k/32k bytes of in-system self-programmable flash ? 512/512/1024 eeprom ? 512/512/1024 internal sram ? write/erase cycles: 10,000 flash/ 100,000 eeprom ? data retention: 20 years at 85 ? c/ 100 years at 25 ? c (1) ? optional boot code section with independent lock bits in-system programming by on-chip boot program hardware-activated after reset true read-while-write operation ? programming lock for software security ? usb 2.0 full-speed device module with interrupt on transfer completion ? complies fully with universal serial bus specification rev 2.0 ? 48 mhz pll for full-speed bus operation : data transfer rates at 12 mbit/s ? fully independant 176 bytes usb dpram for endpoint memory allocation ? endpoint 0 for control transfers: from 8 up to 64-bytes ? 4 programmable endpoints: in or out directions bulk, interrupt and isochronoustransfers programmable maximum packet size from 8 to 64 bytes programmable single or double buffer ? suspend/resume interrupts ? microcontroller reset on usb bus reset without detach ? usb bus disconnection on microcontroller request ? peripheral features ? one 8-bit timer/counters with separate prescaler and compare mode (two 8-bit pwm channels) ? one 16-bit timer/counter with separate prescaler, compare and capture mode (three 8-bit pwm channels) ? usart with spi master only mode and hardware flow control (rts/cts) ? master/slave spi serial interface ? programmable watchdog timer with separate on-chip oscillator ? on-chip analog comparator ? interrupt and wake-up on pin change ? on chip debug interface (debugwire) ? special microcontroller features ? power-on reset and programmable brown-out detection ? internal calibrated oscillator ? external and internal interrupt sources ? five sleep modes: idle, power-save, power-down, standby, and extended standby ? i/o and packages ? 22 programmable i/o lines ? qfn32 (5x5mm) / tqfp32 packages ? operating voltages ? 2.7 - 5.5v ? operating temperature ? industrial (-40c to +85c) ? maximum frequency ? 8 mhz at 2.7v - industrial range ? 16 mhz at 4.5v - industrial range note: 1. see ?data retention? on page 6 for details. 8-bit microcontroller with 8/16/32k bytes of isp flash and usb controller atmega8u2 atmega16u2 atmega32u2 7799es?avr?09/2012
2 7799es?avr?09/2012 atmega8u2/16u2/32u2 1. pin configurations figure 1-1. pinout note: the large center pad underneath the qfn package should be soldered to ground on the board to ensure good mechanical stability. 1.1 disclaimer typical values contained in this datasheet are based on simulations and characterization of other avr microcontrollers manufactured on the same process technology. min and max values will be available after the device is characterized. uvcc qfn32 (pcint11 / ain2 ) pc2 (oc.0b / int0) pd0 vcc xtal1 (int5/ ain3) pd4 (txd1 / int3) pd3 (xck / ain4 / pcint12) pd5 pb3 (pdo / miso / pcint3) gnd (pc0) xtal2 ugnd pb4 (t1 / pcint4) 28 27 26 1 2 3 4 5 6 7 24 23 22 21 20 19 18 12 11 10 9131415 (ain0 / int1) pd1 8 16 17 pb6 (pcint6) d- d+ 25 29 30 31 32 pb7 (pcint7 / oc.0a / oc.1c) pb5 (pcint5) pc7 (int4 / icp1 / clko) pc6 (oc.1a / pcint8) reset (pc1 / dw) pc5 ( pcint9/ oc.1b) pc4 (pcint10) ucap (rxd1 / ain1 / int2) pd2 ( r ts / ain5 / int6) pd6 ( cts / hwb / ain6 / t0 / int7) pd7 ( ss / pcint0) pb0 (sclk / pcint1) pb1 (pdi / mosi / pcint2) pb2 avcc uvcc tqfp32 (pcint11 /ain2 ) pc2 (oc.0b / int0) pd0 vcc xtal1 (int5/ ain3) pd4 (txd1 / int3) pd3 (xck ain4 / pcint12) pd5 pb3 (pdo / miso / pcint3) gnd (pc0) xtal2 ugnd pb4 (t1 / pcint4) 28 27 26 1 2 3 4 5 6 7 24 23 22 21 20 19 18 12 11 10 9131415 (ain0 / int1) pd1 8 16 17 pb6 (pcint6) d- d+ 25 29 30 31 32 pb7 (pcint7 / oc.0a / oc.1c) pb5 (pcint5) pc7 (int4 / icp1 / clko) pc6 (oc.1a / pcint8) reset (pc1 / dw) pc5 ( pcint9/ oc.1b) pc4 (pcint10) ucap (rxd1 / ain1 / int2) pd2 ( r ts / ain5 / int6) pd6 / hwb / ain6 / t0 / int7) pd7 ( ss / pcint0) pb0 (sclk / pcint1) pb1 (pdi / mosi / pcint2) pb2 avcc
3 7799es?avr?09/2012 atmega8u2/16u2/32u2 2. overview the atmega8u2/16u2/32u2 is a low-power cmos 8-bit microc ontroller based on the avr enhanced risc architecture. by executing powerful instructions in a single clock cycle, the atmega8u2/16u2/32u2 achieves throughputs approaching 1 mips per mhz allowing the system designer to optimize power consumption versus processing speed. 2.1 block diagram figure 2-1. block diagram the avr core combines a rich instruction set with 32 general purpose working registers. all the 32 registers are directly connected to the arithmetic logic unit (alu), allowing two independent registers to be accessed in one single instruction executed in one clock cycle. the resulting program counter stack pointer program flash mcu control register sram general purpose registers instruction register timer/ counters instruction decoder data dir. reg. port c data register port c interrupt unit eeprom usart1 status register z y x alu portc drivers portd drivers portb drivers pc7 - pc0 pd7 - pd0 reset vcc gnd xtal1 xtal2 control lines analog comparator pb7 - pb0 d+/sck d-/sdata internal oscillator watchdog timer 8-bit da ta bus usb ps/2 timing and control oscillator calib. osc data dir. reg. port b data register port b on-chip debug debug-wire programming logic data dir. reg. port d data register port d por - bod reset pll + - spi on-chip 3.3v regulator uvcc ucap 1uf
4 7799es?avr?09/2012 atmega8u2/16u2/32u2 architecture is more code efficient while achieving throughputs up to ten times faster than con- ventional cisc microcontrollers. the atmega8u2/16u2/32u2 provides the following features: 8k/16k/32k bytes of in-system programmable flash with read-while-write capabilities, 512/512/1024 bytes eeprom, 512/512/1024 sram, 22 general purpo se i/o lines, 32 general pur pose working registers, two flexible timer/counters with compare modes and pwm, one usart, a programmable watch- dog timer with internal oscillator, an spi serial port, debugwire interface, also used for accessing the on-chip debug system and programming and five software selectable power sav- ing modes. the idle mode stops the cpu while allowing the sram, time r/counters, spi port, and interrupt system to continue functioning. the power-down mode saves the register contents but freezes the oscillator, disabling all other chip functions until the next interrupt or hardware reset. in standby mode, the crystal/resonator oscillator is running while the rest of the device is sleeping. this allows very fast start-up combined with low power consumption. in extended standby mode, the main oscillator continues to run. the device is manufactured using atmel?s high-density nonvolatile memory technology. the on- chip isp flash allows the program memory to be reprogrammed in-system through an spi serial interface, by a conventional nonvolatile memory programmer, or by an on-chip boot program running on the avr core. the boot program can use any interface to download the application program in the application flash memory. software in the boot flash section will continue to run while the application flash section is updated, providing true read-while-write operation. by combining an 8-bit risc cpu with in-system self-programmable flash on a monolithic chip, the atmel atmega8u2/16u2/32u2 is a powerful microcontroller that provides a highly flexible and cost effective solution to many embedded control applications. the atmega8u2/16u2/32u2 are supported with a full suite of program and system develop- ment tools including: c compilers, macro assemblers, program debugger/simulators, in-circuit emulators, and evaluation kits. 2.2 pin descriptions 2.2.1 vcc digital supply voltage. 2.2.2 gnd ground. 2.2.3 avcc avcc is the supply voltage pin (input) for all analog features (analog comparator, pll). it should be externally connected to vcc through a low-pass filter. 2.2.4 port b (pb7..pb0) port b is an 8-bit bi-directional i/o port with internal pull-up resistors (selected for each bit). the port b output buffers have symmetrical drive characteristics with both high sink and source capability. as inputs, port b pins that are externally pulled low will source current if the pull-up resistors are activated. the port b pins are tri-stated when a reset condition becomes active, even if the clock is not running. port b also serves the functions of various special features of the atmega8u2/16u2/32u2 as listed on page 74 .
5 7799es?avr?09/2012 atmega8u2/16u2/32u2 2.2.5 port c (pc7..pc0) port c is an 8-bit bi-directional i/o port with internal pull-up resistors (selected for each bit). the port c output buffers have symmetrical drive characteristics with both high sink and source capability. as inputs, port c pins that are extern ally pulled low will source current if the pull-up resistors are activated. the port c pins are tri-stated when a reset condition becomes active, even if the clock is not running. port c also serves the functions of various special features of the atmega8u2/16u2/32u2 as listed on page 77 . 2.2.6 port d (pd7..pd0) port d serves as analog inputs to the analog comparator. port d also serves as an 8-bit bi-directional i/o port, if the analog comparator is not used (con- cerns pd2/pd1 pins). port pins can provide internal pull-up resistors (selected for each bit). the port d output buffers have symmetrical drive characteristics with both high sink and source capability. as inputs, port d pins that are extern ally pulled low will source current if the pull-up resistors are activated. the port d pins are tri-stated when a reset condition becomes active, even if the clock is not running. 2.2.7 d- usb full speed negative data upstream port 2.2.8 d+ usb full speed positive data upstream port 2.2.9 ugnd usb ground. 2.2.10 uvcc usb pads internal regulator input supply voltage. 2.2.11 ucap usb pads internal regulator output supply voltage. should be connected to an external capac- itor (1 f). 2.2.12 reset/pc1/dw reset input. a low level on this pin for longer than the minimum pulse length will generate a reset, even if the clock is not running. the minimum pulse length is given in ?system control and reset? on page 47 . shorter pulses are not guaranteed to generate a reset. this pin alternatively serves as debugwire channel or as generic i/o. the configuration depends on the fuses rst- disbl and dwen. 2.2.13 xtal1 input to the inverting oscillator amplifier and input to the internal clock operating circuit. 2.2.14 xtal2/pc0 output from the inverting oscillator amplifier if enabled by fuse. also serves as a generic i/o.
6 7799es?avr?09/2012 atmega8u2/16u2/32u2 3. resources a comprehensive set of development tools, application notes and datasheets are available for download on http://www.atmel.com/avr. 4. code examples this documentation contains simple code examples that briefly show how to use various parts of the device. be aware that not all c compiler vendors include bit definitions in the header files and interrupt handling in c is compiler dependent. please confirm with the c compiler documen- tation for more details. these code examples assume that the part specif ic header file is includ ed before compilation. for i/o registers located in extended i/o map, "in", "out", "sbis", "sbic", "cbi", and "sbi" instructions must be replaced with instructions that allow access to extended i/o. typically "lds" and "sts" combined with "sbrs", "sbrc", "sbr", and "cbr". 5. data retention reliability qualification results show that the projected data retention failure rate is much less than 1 ppm over 20 years at 85c or 100 years at 25c.
7 7799es?avr?09/2012 atmega8u2/16u2/32u2 6. register summary address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 page (0xff) reserved - - - - - - - - (0xfe) reserved - - - - - - - - (0xfd) reserved - - - - - - - - (0xfc) reserved - - - - - - - - (0xfb) upoe upwe1 upwe0 updrv1 updrv0 scki datai dpi dmi page 195 (0xfa) reserved - - - - - - - - (0xf9) reserved - - - - - - - - (0xf8) reserved - - - - - - - - (0xf7) reserved - - - - - - - - (0xf6) reserved - - - - - - - - (0xf5) reserved - - - - - - - - (0xf4) ueint - - epint4:0 page 222 (0xf3) reserved - - - - - - - - (0xf2) uebclx byct7:0 page 221 (0xf1) uedatx dat7:0 page 221 (0xf0) ueienx flerre nakine - nakoute rxstpe rxoute stallede txine page 220 (0xef) uesta1x - - - - - ctrldir currbk1:0 page 218 (0xee) uesta0x cfgok overfi underfi - dtseq1:0 nbusybk1:0 page 217 (0xed) uecfg1x - epsize2:0 epbk1:0 alloc - page 216 (0xec) uecfg0x eptype1:0 - - - - - epdir page 215 (0xeb) ueconx - - stallrq stallrqc rstdt - - epen page 214 (0xea) uerst - - - eprst4:0 page 214 (0xe9) uenum - - - - - epnum2:0 page 214 (0xe8) ueintx fifocon nakini rwal nakouti rxstpi rxouti stalledi txini page 219 (0xe7) reserved - - - - - - - - (0xe6) udmfn - - - fncerr - - - - page 213 (0xe5) udfnumh - - - - - fnum10:8 page 213 (0xe4) udfnuml fnum7:0 page 213 (0xe3) udaddr adden uadd6:0 page 212 (0xe2) udien - uprsme eorsme wakeupe eorste sofe - suspe page 211 (0xe1) udint - uprsmi eorsmi wakeupi eorsti sofi - suspi page 210 (0xe0) udcon - - - rputx - rstcpu rmwkup detach page 209 (0xdf) reserved - - - - - - - - (0xde) reserved - - - - - - - - (0xdd) reserved - - - - - - - - (0xdc) reserved - - - - - - - - (0xdb) reserved - - - - - - - - (0xda) reserved - - - - - - - - (0xd9) reserved - - - - - - - - (0xd8) usbcon usbe - frzclk - - - - - page 195 (0xd7) reserved - - - - - - - - (0xd6) reserved - - - - - - - - (0xd5) reserved - - - - - - - - (0xd4) reserved - - - - - - - - (0xd3) reserved - - - - - - - - (0xd2) clksta - - - - - - rcon exton page 38 (0xd1) clksel1 rccksel3 rccksel2 rccksel1 rccksel0 excksel3 excksel2 excksel1 excksel0 page 38 (0xd0) clksel0 rcsut1 rcsut0 exsut1 exsut0 rce exte - clks page 37 (0xcf) reserved - - - - - - - - (0xce) udr1 usart1 i/o data register page 167 (0xcd) ubrr1h - - - - usart1 baud rate register high byte page 171 (0xcc) ubrr1l usart1 baud rate register low byte page 171 (0xcb) ucsr1d - - - - - - ctsen rtsen page 171 (0xca) ucsr1c umsel11 umsel10 upm11 upm10 usbs1 ucsz11 ucsz10 ucpol1 page 169 (0xc9) ucsr1b rxcie1 txcie1 udrie1 rxen1 txen1 ucsz12 rxb81 txb81 page 168 (0xc8) ucsr1a rxc1 txc1 udre1 fe1 dor1 pe1 u2x1 mpcm1 page 167 (0xc7) reserved - - - - - - - - (0xc6) reserved - - - - - - - - (0xc5) reserved - - - - - - - - (0xc4) reserved - - - - - - - - (0xc3) reserved - - - - - - - - (0xc2) reserved - - - - - - - - (0xc1) reserved - - - - - - - - (0xc0) reserved - - - - - - - - (0xbf) reserved - - - - - - - -
8 7799es?avr?09/2012 atmega8u2/16u2/32u2 (0xbe) reserved - - - - - - - - (0xbd) reserved - - - - - - - - (0xbc) reserved - - - - - - - - (0xbb) reserved - - - - - - - - (0xba) reserved - - - - - - - - (0xb9) reserved - - - - - - - - (0xb8) reserved - - - - - - - - (0xb7) reserved - - - - - - - - (0xb6) reserved - - - - - - - - (0xb5) reserved - - - - - - - - (0xb4) reserved - - - - - - - - (0xb3) reserved - - - - - - - - (0xb2) reserved - - - - - - - - (0xb1) reserved - - - - - - - - (0xb0) reserved - - - - - - - - (0xaf) reserved - - - - - - - - (0xae) reserved - - - - - - - - (0xad) reserved - - - - - - - - (0xac) reserved - - - - - - - - (0xab) reserved - - - - - - - - (0xaa) reserved - - - - - - - - (0xa9) reserved - - - - - - - - (0xa8) reserved - - - - - - - - (0xa7) reserved - - - - - - - - (0xa6) reserved - - - - - - - - (0xa5) reserved - - - - - - - - (0xa4) reserved - - - - - - - - (0xa3) reserved - - - - - - - - (0xa2) reserved - - - - - - - - (0xa1) reserved - - - - - - - - (0xa0) reserved - - - - - - - - (0x9f) reserved - - - - - - - - (0x9e) reserved - - - - - - - - (0x9d) reserved - - - - - - - - (0x9c) reserved - - - - - - - - (0x9b) reserved - - - - - - - - (0x9a) reserved - - - - - - - - (0x99) reserved - - - - - - - - (0x98) reserved - - - - - - - - (0x97) reserved - - - - - - - - (0x96) reserved - - - - - - - - (0x95) reserved - - - - - - - - (0x94) reserved - - - - - - - - (0x93) reserved - - - - - - - - (0x92) reserved - - - - - - - - (0x91) reserved - - - - - - - - (0x90) reserved - - - - - - - - (0x8f) reserved - - - - - - - - (0x8e) reserved - - - - - - - - (0x8d) ocr1ch timer/counter1 - output compare register c high byte page 135 (0x8c) ocr1cl timer/counter1 - output compare register c low byte page 135 (0x8b) ocr1bh timer/counter1 - output compare register b high byte page 135 (0x8a) ocr1bl timer/counter1 - output compare register b low byte page 135 (0x89) ocr1ah timer/counter1 - output compare register a high byte page 135 (0x88) ocr1al timer/counter1 - output compare register a low byte page 135 (0x87) icr1h timer/counter1 - input capture register high byte page 135 (0x86) icr1l timer/counter1 - input capture register low byte page 135 (0x85) tcnt1h timer/counter1 - counter register high byte page 134 (0x84) tcnt1l timer/counter1 - counter register low byte page 134 (0x83) reserved - - - - - - - - (0x82) tccr1c foc1a foc1b foc1c - - - - - page 134 (0x81) tccr1b icnc1 ices1 - wgm13 wgm12 cs12 cs11 cs10 page 133 (0x80) tccr1a com1a1 com1a0 com1b1 com1b0 com1c1 com1c0 wgm11 wgm10 page 129 (0x7f) didr1 - ain6d ain5d ain4d ain3d ain2d ain1d ain0d page 225 (0x7e) reserved - - - - - - - - (0x7d) acmux - - - - - cmux2 cmux1 cmux0 page 225 address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 page
9 7799es?avr?09/2012 atmega8u2/16u2/32u2 (0x7c) reserved - - - - - - - - (0x7b) reserved - - - - - - - - (0x7a) reserved - - - - - - - - (0x79) reserved - - - - - - - - (0x78) reserved - - - - - - - - (0x77) reserved - - - - - - - - (0x76) reserved - - - - - - - - (0x75) reserved - - - - - - - - (0x74) reserved - - - - - - - - (0x73) reserved - - - - - - - - (0x72) reserved - - - - - - - - (0x71) reserved - - - - - - - - (0x70) reserved - - - - - - - - (0x6f) timsk1 - - icie1 - ocie1c ocie1b ocie1a toie1 page 135 (0x6e) timsk0 - - - - - ocie0b ocie0a toie0 page 106 (0x6d) reserved - - - - - - - - (0x6c) pcmsk1 - - - pcint12 pcint11 pcint10 pcint9 pcint8 page 87 (0x6b) pcmsk0 pcint7 pcint6 pcint5 pcint4 pcint3 pcint2 pcint1 pcint0 page 87 (0x6a) eicrb isc71 isc70 isc61 isc60 isc51 isc50 isc41 isc40 page 85 (0x69) eicra isc31 isc30 isc21 isc20 isc11 isc10 isc01 isc00 page 84 (0x68) pcicr - - - - - - pcie1 pcie0 page 86 (0x67) reserved - - - - - - - - (0x66) osccal oscillator calibration register page 38 (0x65) prr1 prusb - - - - - - prusart1 page 46 (0x64) prr0 - - prtim0 - prtim1 prspi - - page 46 (0x63) regcr - - - - - - - regdis page 196 (0x62) wdtckd - - wdewifcm wclkd2 wdewif wdewie wclkd1 wclkd0 page 57 (0x61) clkpr clkpce - - - clkps3 clkps2 clkps1 clkps0 page 39 (0x60) wdtcsr wdif wdie wdp3 wdce wde wdp2 wdp1 wdp0 page 56 0x3f (0x5f) sreg i t h s v n z c page 9 0x3e (0x5e) sph sp15 sp14 sp13 sp12 sp11 sp10 sp9 sp8 page 12 0x3d (0x5d) spl sp7 sp6 sp5 sp4 sp3 sp2 sp1 sp0 page 12 0x3c (0x5c) reserved - - - - - - - - 0x3b (0x5b) reserved - - - - - - - - 0x3a (0x5a) reserved - - - - - - - - 0x39 (0x59) reserved - - - - - - - - 0x38 (0x58) reserved - - - - - - - - 0x37 (0x57) spmcsr spmie rwwsb sigrd rwwsre blbset pgwrt pgers spmen page 242 0x36 (0x56) reserved - - - - - - - - 0x35 (0x55) mcucr - - - - - - ivsel ivce page 65 , 82 0x34 (0x54) mcusr - - usbrf - wdrf borf extrf porf page 55 0x33 (0x53) smcr - - - - sm2 sm1 sm0 se page 45 0x32 (0x52) reserved - - - - - - - - 0x31 (0x51) dwdr debugwire data register page 245 0x30 (0x50) acsr acd acbg aco aci acie acic acis1 acis0 page 224 0x2f (0x4f) reserved - - - - - - - - 0x2e (0x4e) spdr spi data register page 147 0x2d (0x4d) spsr spif wcol - - - - - spi2x page 146 0x2c (0x4c) spcr spie spe dord mstr cpol cpha spr1 spr0 page 145 0x2b (0x4b) gpior2 general purpose i/o register 2 page 24 0x2a (0x4a) gpior1 general purpose i/o register 1 page 24 0x29 (0x49) pllcsr - - - pllp2 pllp1 pllp0 plle plock page 40 0x28 (0x48) ocr0b timer/counter0 output compare register b page 106 0x27 (0x47) ocr0a timer/counter0 output compare register a page 106 0x26 (0x46) tcnt0 timer/counter0 (8 bit) page 106 0x25 (0x45) tccr0b foc0a foc0b - - wgm02 cs02 cs01 cs00 page 105 0x24 (0x44) tccr0a com0a1 com0a0 com0b1 com0b0 - - wgm01 wgm00 page 105 0x23 (0x43) gtccr tsm - - - - - psrasy psrsync page 89 0x22 (0x42) eearh - - - - eeprom address register high byte page 20 0x21 (0x41) eearl eeprom address register low byte page 20 0x20 (0x40) eedr eeprom data register page 20 0x1f (0x3f) eecr - - eepm1 eepm0 eerie eempe eepe eere page 21 0x1e (0x3e) gpior0 general purpose i/o register 0 page 25 0x1d (0x3d) eimsk int7 int6 int5 int4 int3 int2 int1 int0 page 86 0x1c (0x3c) eifr intf7 intf6 intf5 intf4 intf3 intf2 intf1 intf0 page 86 0x1b (0x3b) pcifr - - - - - - pcif1 pcif0 page 86 address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 page
10 7799es?avr?09/2012 atmega8u2/16u2/32u2 note: 1. for compatibility with future devices, reserved bits should be written to zero if accessed. moreover reserved bits are n ot guaranteed to be read as ?0?. reserved i/o memory addresses should never be written. 2. i/o registers within the address range $00 - $1f are directly bit-accessible using the sbi and cbi instructions. in these reg - isters, the value of single bits can be checked by using the sbis and sbic instructions. 3. some of the status flags are cleared by writing a logical one to them. note that the cbi and sbi instructions will operate on all bits in the i/o register, writing a one back into any flag read as set, thus clearing the flag. the cbi and sbi instruction s work with registers 0x00 to 0x1f only. 4. when using the i/o specific commands in and out, the i/o addresses $00 - $3f must be used. when addressing i/o reg- isters as data space using ld and st instructions, $20 must be added to these addresses. the atmega8u2/16u2/32u2 is a complex microcontroller with more peripheral units than can be supported within the 64 location reserved in opcode for the in and out instructions. for the extended i/o space from $60 - $1ff in sram, only the st/sts/std and ld/lds/ldd instructions can be used. 0x1a (0x3a) reserved - - - - - - - - 0x19 (0x39) reserved - - - - - - - - 0x18 (0x38) reserved - - - - - - - - 0x17 (0x37) reserved - - - - - - - - 0x16 (0x36) tifr1 - - icf1 - ocf1c ocf1b ocf1a tov1 page 136 0x15 (0x35) tifr0 - - - - - ocf0b ocf0a tov0 page 107 0x14 (0x34) reserved - - - - - - - - 0x13 (0x33) reserved - - - - - - - - 0x12 (0x32) reserved - - - - - - - - 0x11 (0x31) reserved - - - - - - - - 0x10 (0x30) reserved - - - - - - - - 0x0f (0x2f) reserved - - - - - - - - 0x0e (0x2e) reserved - - - - - - - - 0x0d (0x2d) reserved - - - - - - - - 0x0c (0x2c) reserved - - - - - - - - 0x0b (0x2b) portd portd7 portd6 portd5 portd4 portd3 portd2 portd1 portd0 page 83 0x0a (0x2a) ddrd ddd7 ddd6 ddd5 ddd4 ddd3 ddd2 ddd1 ddd0 page 83 0x09 (0x29) pind pind7 pind6 pind5 pind4 pind3 pind2 pind1 pind0 page 83 0x08 (0x28) portc portc7 portc6 portc5 portc4 - portc2 portc1 portc0 page 82 0x07 (0x27) ddrc ddc7 ddc6 ddc5 ddc4 - ddc2 ddc1 ddc0 page 82 0x06 (0x26) pinc pinc7 pinc6 pinc5 pinc4 - pinc2 pinc1 pinc0 page 82 0x05 (0x25) portb portb7 portb6 portb5 portb4 portb3 portb2 portb1 portb0 page 82 0x04 (0x24) ddrb ddb7 ddb6 ddb5 ddb4 ddb3 ddb2 ddb1 ddb0 page 82 0x03 (0x23) pinb pinb7 pinb6 pinb5 pinb4 pinb3 pinb2 pinb1 pinb0 page 82 0x02 (0x22) reserved - - - - - - - - 0x01 (0x21) reserved - - - - - - - - 0x00 (0x20) reserved - - - - - - - - address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 page
11 7799es?avr?09/2012 atmega8u2/16u2/32u2 7. instruction set summary mnemonics operands description operation flags #clocks arithmetic and logic instructions add rd, rr add two registers rd ? rd + rr z,c,n,v,h 1 adc rd, rr add with carry two registers rd ? rd + rr + c z,c,n,v,h 1 adiw rdl,k add immediate to word rdh:rdl ? rdh:rdl + k z,c,n,v,s 2 sub rd, rr subtract two registers rd ? rd - rr z,c,n,v,h 1 subi rd, k subtract constant from register rd ? rd - k z,c,n,v,h 1 sbc rd, rr subtract with carry two registers rd ? rd - rr - c z,c,n,v,h 1 sbci rd, k subtract with carry constant from reg. rd ? rd - k - c z,c,n,v,h 1 sbiw rdl,k subtract immediate from word rdh:rdl ? rdh:rdl - k z,c,n,v,s 2 and rd, rr logical and registers rd ?? rd ? rr z,n,v 1 andi rd, k logical and register and constant rd ? rd ?? k z,n,v 1 or rd, rr logical or registers rd ? rd v rr z,n,v 1 ori rd, k logical or register and constant rd ?? rd v k z,n,v 1 eor rd, rr exclusive or registers rd ? rd ? rr z,n,v 1 com rd one?s complement rd ? 0xff ? rd z,c,n,v 1 neg rd two?s complement rd ? 0x00 ? rd z,c,n,v,h 1 sbr rd,k set bit(s) in register rd ? rd v k z,n,v 1 cbr rd,k clear bit(s) in register rd ? rd ? (0xff - k) z,n,v 1 inc rd increment rd ? rd + 1 z,n,v 1 dec rd decrement rd ? rd ? 1 z,n,v 1 tst rd test for zero or minus rd ? rd ? rd z,n,v 1 clr rd clear register rd ? rd ? rd z,n,v 1 ser rd set register rd ? 0xff none 1 branch instructions rjmp k relative jump pc ?? pc + k + 1 none 2 ijmp indirect jump to (z) pc ? z none 2 jmp k direct jump pc ?? k none 3 rcall k relative subroutine call pc ? pc + k + 1 none 4 icall indirect call to (z) pc ? z none 4 call k direct subroutine call pc ? k none 5 ret subroutine return pc ? stack none 5 reti interrupt return pc ? stack i 5 cpse rd,rr compare, skip if equal if (rd = rr) pc ?? pc + 2 or 3 none 1/2/3 cp rd,rr compare rd ? rr z, n,v,c,h 1 cpc rd,rr compare with carry rd ? rr ? c z, n,v,c,h 1 cpi rd,k compare register with immediate rd ? k z, n,v,c,h 1 sbrc rr, b skip if bit in register cleared if (rr(b)=0) pc ? pc + 2 or 3 none 1/2/3 sbrs rr, b skip if bit in register is set if (rr(b)=1) pc ? pc + 2 or 3 none 1/2/3 sbic p, b skip if bit in i/o register cleared if (p(b)=0) pc ? pc + 2 or 3 none 1/2/3 sbis p, b skip if bit in i/o register is set if (p(b)=1) pc ? pc + 2 or 3 none 1/2/3 brbs s, k branch if status flag set if (sreg(s) = 1) then pc ? pc+k + 1 none 1/2 brbc s, k branch if status flag cleared if (sreg(s) = 0) then pc ? pc+k + 1 none 1/2 breq k branch if equal if (z = 1) then pc ? pc + k + 1 none 1/2 brne k branch if not equal if (z = 0) then pc ? pc + k + 1 none 1/2 brcs k branch if carry set if (c = 1) then pc ? pc + k + 1 none 1/2 brcc k branch if carry cleared if (c = 0) then pc ? pc + k + 1 none 1/2 brsh k branch if same or higher if (c = 0) then pc ? pc + k + 1 none 1/2 brlo k branch if lower if (c = 1) then pc ? pc + k + 1 none 1/2 brmi k branch if minus if (n = 1) then pc ? pc + k + 1 none 1/2 brpl k branch if plus if (n = 0) then pc ? pc + k + 1 none 1/2 brge k branch if greater or equal, signed if (n ? v= 0) then pc ? pc + k + 1 none 1/2 brlt k branch if less than zero, signed if (n ? v= 1) then pc ? pc + k + 1 none 1/2 brhs k branch if half carry flag set if (h = 1) then pc ? pc + k + 1 none 1/2 brhc k branch if half carry flag cleared if (h = 0) then pc ? pc + k + 1 none 1/2 brts k branch if t flag set if (t = 1) then pc ? pc + k + 1 none 1/2 brtc k branch if t flag cleared if (t = 0) then pc ? pc + k + 1 none 1/2 brvs k branch if overflow flag is set if (v = 1) then pc ? pc + k + 1 none 1/2 brvc k branch if overflow flag is cleared if (v = 0) then pc ? pc + k + 1 none 1/2 brie k branch if interrupt enabled if ( i = 1) then pc ? pc + k + 1 none 1/2 brid k branch if interrupt disabled if ( i = 0) then pc ? pc + k + 1 none 1/2 bit and bit-test instructions sbi p,b set bit in i/o register i/o(p,b) ? 1 none 2 cbi p,b clear bit in i/o register i/o(p,b) ? 0 none 2 lsl rd logical shift left rd(n+1) ? rd(n), rd(0) ? 0 z,c,n,v 1 lsr rd logical shift right rd(n) ? rd(n+1), rd(7) ? 0 z,c,n,v 1
12 7799es?avr?09/2012 atmega8u2/16u2/32u2 rol rd rotate left through carry rd(0) ? c,rd(n+1) ? rd(n),c ? rd(7) z,c,n,v 1 ror rd rotate right through carry rd(7) ? c,rd(n) ? rd(n+1),c ? rd(0) z,c,n,v 1 asr rd arithmetic shift right rd(n) ? rd(n+1), n=0..6 z,c,n,v 1 swap rd swap nibbles rd(3..0) ? rd(7..4),rd(7..4) ? rd(3..0) none 1 bset s flag set sreg(s) ? 1 sreg(s) 1 bclr s flag clear sreg(s) ? 0 sreg(s) 1 bst rr, b bit store from register to t t ? rr(b) t 1 bld rd, b bit load from t to register rd(b) ? t none 1 sec set carry c ? 1c1 clc clear carry c ? 0 c 1 sen set negative flag n ? 1n1 cln clear negative flag n ? 0 n 1 sez set zero flag z ? 1z1 clz clear zero flag z ? 0 z 1 sei global interrupt enable i ? 1i1 cli global interrupt disable i ?? 0 i 1 ses set signed test flag s ? 1s1 cls clear signed test flag s ? 0 s 1 sev set twos complement overflow. v ? 1v1 clv clear twos complement overflow v ? 0 v 1 set set t in sreg t ? 1t1 clt clear t in sreg t ? 0 t 1 seh set half carry flag in sreg h ? 1h1 clh clear half carry flag in sreg h ? 0 h 1 data transfer instructions mov rd, rr move between registers rd ? rr none 1 movw rd, rr copy register word rd+1:rd ? rr+1:rr none 1 ldi rd, k load immediate rd ? k none 1 ld rd, x load indirect rd ? (x) none 2 ld rd, x+ load indirect and post-inc. rd ? (x), x ? x + 1 none 2 ld rd, - x load indirect and pre-dec. x ? x - 1, rd ? (x) none 2 ld rd, y load indirect rd ? (y) none 2 ld rd, y+ load indirect and post-inc. rd ? (y), y ? y + 1 none 2 ld rd, - y load indirect and pre-dec. y ? y - 1, rd ? (y) none 2 ldd rd,y+q load indirect with displacement rd ? (y + q) none 2 ld rd, z load indirect rd ? (z) none 2 ld rd, z+ load indirect and post-inc. rd ? (z), z ? z+1 none 2 ld rd, -z load indirect and pre-dec. z ? z - 1, rd ? (z) none 2 ldd rd, z+q load indirect with displacement rd ? (z + q) none 2 lds rd, k load direct from sram rd ? (k) none 2 st x, rr store indirect (x) ?? rr none 2 st x+, rr store indirect and post-inc. (x) ?? rr, x ? x + 1 none 2 st - x, rr store indirect and pre-dec. x ? x - 1, (x) ? rr none 2 st y, rr store indirect (y) ? rr none 2 st y+, rr store indirect and post-inc. (y) ? rr, y ? y + 1 none 2 st - y, rr store indirect and pre-dec. y ? y - 1, (y) ? rr none 2 std y+q,rr store indirect with displacement (y + q) ? rr none 2 st z, rr store indirect (z) ? rr none 2 st z+, rr store indirect and post-inc. (z) ? rr, z ? z + 1 none 2 st -z, rr store indirect and pre-dec. z ? z - 1, (z) ? rr none 2 std z+q,rr store indirect with displacement (z + q) ? rr none 2 sts k, rr store direct to sram (k) ? rr none 2 lpm load program memory r0 ? (z) none 3 lpm rd, z load program memory rd ? (z) none 3 lpm rd, z+ load program memory and post-inc rd ? (z), z ? z+1 none 3 spm store program memory (z) ? r1:r0 none - in rd, p in port rd ? p none 1 out p, rr out port p ? rr none 1 push rr push register on stack stack ? rr none 2 pop rd pop register from stack rd ? stack none 2 mcu control instructions nop no operation none 1 sleep sleep (see specific descr. for sleep function) none 1 wdr watchdog reset (see specific descr. for wdr/timer) none 1 break break for on-chip debug only none n/a mnemonics operands description operation flags #clocks
13 7799es?avr?09/2012 atmega8u2/16u2/32u2 8. ordering information 8.1 atmega8u2 speed power supply ordering code package operational range 16 mhz 2.7 - 5.5v atmega8u2-au 32a -40 ? c to +85 ? c atmega8u2-mu 32m1-a package type 32a 32-lead, 7 x7 x 1.2 mm, lead pitch 0.8 mm thin quad flat package 32m1 32-pad, 5 x 5 x 1 mm body, pad pitch 0.50 mm quad flat no lead (qfn)
14 7799es?avr?09/2012 atmega8u2/16u2/32u2 8.2 atmega16u2 speed power supply ordering code package operational range 16 mhz 2.7 - 5.5v ATMEGA16U2-AU 32a -40 ? c to +85 ? c atmega16u2-mu 32m1-a package type 32a 32-lead, 7 x7 x 1.2 mm, lead pitch 0.8 mm thin quad flat package 32m1 32-pad, 5 x 5 x 1 mm body, pad pitch 0.50 mm quad flat no lead (qfn)
15 7799es?avr?09/2012 atmega8u2/16u2/32u2 8.3 atmega32u2 speed power supply ordering code package operational range 16 mhz 2.7 - 5.5v atmega32u2-au 32a -40 ? c to +85 ? c atmega32u2-mu 32m1-a package type 32a 32-lead, 7 x7 x 1.2 mm, lead pitch 0.8 mm thin quad flat package 32m1 32-pad, 5 x 5 x 1 mm body, pad pitch 0.50 mm quad flat no lead (qfn)
16 7799es?avr?09/2012 atmega8u2/16u2/32u2 9. packaging information 9.1 qfn32
17 7799es?avr?09/2012 atmega8u2/16u2/32u2 9.2 tqfp32
18 7799es?avr?09/2012 atmega8u2/16u2/32u2 10. errata 10.1 errata atmega8u2 the revision letter in this section refers to the revision of the atmega8u2 device. 10.1.1 rev. a and rev b ? full swing oscillator 1. full swing oscillator the maximum frequency for the full swing crystal oscillator is 8mhz. for crystal frequen- cies > 8mhz the full swing crystal oscillator is not guaranteed to operate correctly. problem fix/workaround if a crystal with frequency > 8mhz is used, the low power crystal oscillator option should be used instead. see table 8-1 for an overview of the device clocking options. note that the low power crystal oscillator will not provide full rail-to-rail swing on the xtal2 pin. if sys- tem clock output is needed to drive other clock inputs while running from the low power crystal oscillator, the system clock can be output on portc7 by programming the ckout fuse. 10.2 errata atmega16u2 the revision letter in this section refers to the revision of the atmega16u2 device. 10.2.1 rev. a and rev b ? full swing oscillator 1. full swing oscillator the maximum frequency for the full swing crystal oscillator is 8mhz. for crystal frequen- cies > 8mhz the full swing crystal oscillator is not guaranteed to operate correctly. problem fix/workaround if a crystal with frequency > 8mhz is used, the low power crystal oscillator option should be used instead. see table 8-1 for an overview of the device clocking options. note that the low power crystal oscillator will not provide full rail-to-rail swing on the xtal2 pin. if sys- tem clock output is needed to drive other clock inputs while running from the low power crystal oscillator, the system clock can be output on portc7 by programming the ckout fuse. 10.3 errata atmega32u2 the revision letter in this section refers to the revision of the atmega32u2 device. 10.3.1 rev. c no known errata
19 7799es?avr?09/2012 atmega8u2/16u2/32u2 10.3.2 rev. a and rev b ? full swing oscillator 1. full swing oscillator the maximum frequency for the full swing crystal oscillator is 8mhz. for crystal frequen- cies > 8mhz the full swing crystal oscillator is not guaranteed to operate correctly. problem fix/workaround if a crystal with frequency > 8mhz is used, the low power crystal oscillator option should be used instead. see table 8-1 for an overview of the device clocking options. note that the low power crystal oscillator will not provide full rail-to-rail swing on the xtal2 pin. if sys- tem clock output is needed to drive other clock inputs while running from the low power crystal oscillator, the system clock can be output on portc7 by programming the ckout fuse.
20 7799es?avr?09/2012 atmega8u2/16u2/32u2 11. datasheet revision history please note that the referring page numbers in this section are referred to this document. the referring revision in this section are referring to the document revision. 11.1 rev.7799e ? 09/12 11.2 rev. 7799d ? 11/10 11.3 rev. 7799c ? 12/09 11.4 rev. 7799b ? 06/09 1. renamed package name in figure 1-1 on page 2 from vqfp32 to tqfp32. 2. corrected typos. 1. updated the footnote on page 2. removed the vqfp from the footnote 2. updated section 20-4 ?typical bus powered application with 3.3v i/o? on page 187 . 3. updated figure 20-6 on page 188 . by connecting uvcc to 3v power-supply. 4. updated table 21-2 on page 215 . 10: bulk type, and 01: isochronous type 5. added uvcc limits in electrical characteristics 6. updated ?electrical characteristics? on page 264 . added usb d+ internal pull-up (streaming mode) 7. updated ?register summary? on page 7 . added didr1 (adress: 0x7f) 8. removed figure 27-26: usb regulator consumption with load 75 ? vs. vcc 1. updated ?features? on page 1 . 2. added description of ?avcc? on page 4 . 3. updated figure 7-2 on page 18 . 4. updated figure 20-3 on page 186 and figure 20-4 on page 187 . 5. updated ?fuse bits? on page 247 . 6. updated ?dc characteristics? on page 264 . 7. updated table 26-3 on page 267 , by removing vrst. 8. updated table 26-4 on page 268 . 9. updated ?typical characteristics? on page 273 . 10. added new ?errata? on page 18 . 1. updated ?typical characteristics? on page 273 .
21 7799es?avr?09/2012 atmega8u2/16u2/32u2 11.5 rev. 7799a ? 03/09 1. initial revision.
7799es?avr?09/2012 atmel corporation 2325 orchard parkway san jose, ca 95131 usa tel : (+1)(408) 441-0311 fax : (+1)(408) 487-2600 www.atmel.com atmel asia limited unit 1-5 & 16, 19/f bea tower, millennium city 5 418 kwun tong road kwun tong, kowloon hong kong tel : (+852) 2245-6100 fax : (+852) 2722-1369 atmel munich gmbh business campus parkring 4 d-85748 garching b. munich germany tel : (+49) 89-31970-0 fax : (+49) 89-3194621 atmel japan 9f, tonetsu shinkawa bldg. 1-24-8 shinkawa chuo-ku, tokyo 104-0033 japan tel : (+81)(3) 3523-3551 fax : (+81)(3) 3523-7581 ? 2010 atmel corporation. all rights reserved. atmel ? , logo and combinations thereof, and others are registered trademarks or trademarks of atmel corporation or its subsidiaries. other terms and product names may be trademarks of others. disclaimer: the information in this document is provided in connection with atmel products. no license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of atmel products. except as set forth in the atmel terms and conditions of sales located on the atmel website, atmel assumes no liability whatsoever and disclaims any express, implied or statutory warranty relating to its products including, but not limited to, the implied warranty of merchantability, fitness for a particular purpose, or non-infringement. in no event shall atmel be liable for any direct, indirect, consequential, punitive, special or incidental damages (including, without limitation, damages for loss and prof- its, business interruption, or loss of information) arising out of the use or inability to use this document, even if atmel has been advised of the possibility of such damages. atmel makes no representations or warranties with respect to the accuracy or com- pleteness of the contents of this document and reserves the right to make changes to specifications and product descriptions at any time without notice. atmel does not make any commitment to update the information contained herein. unless specifically provided otherwise, atmel pr oducts are not suit- able for, and shall not be used in, automotive applications. atmel products are not intended, authorized, or warranted for use as components in applica- tions intended to support or sustain life.


▲Up To Search▲   

 
Price & Availability of ATMEGA16U2-AU

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X